// pages/edit_list.js
var api = require("../../api.js")
const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    pic_url:'',
    data_tip:[],
    height:20,
    act_modal_list:[
      {
        active_color: "#ff4544",
        active_icon: "http://ys.mingsxx.com/web/statics/images/appnavbar/nav-icon-index.active.png",
        color: "#888",
        icon: "http://ys.mingsxx.com/web/statics/images/appnavbar/nav-icon-index.png",
        new_url: "/pages/index/index",
        text: "商城",
        index:0
      },
      {
        active_color: "#ff4544",
        active_icon: "http://ys.mingsxx.com/web/statics/images/appnavbar/nav-icon-cat.active.png",
        color: "#888",
        icon: "http://ys.mingsxx.com/web/statics/images/appnavbar/nav-icon-cat.png",
        new_url: "/pages/vip/vip",
        text: "关于马库",
        url: "/pages/vip/vip",
        index:1
      },
      {
        active_color: "#ff4544",
        active_icon: "http://ys.mingsxx.com/web/statics/images/appnavbar/nav-icon-cart.active.png",
        color: "#888",
        icon: "http://ys.mingsxx.com/web/statics/images/appnavbar/nav-icon-cart.png",
        new_url: "/pages/cart/cart",
        text: "购物车",
        url: "/pages/cart/cart",
        index:2
      },
      {
        active_color: "#ff4544",
        active_icon: "http://ys.mingsxx.com/web/statics/images/appnavbar/nav-icon-user.active.png",
        color: "#888",
        icon: "http://ys.mingsxx.com/web/statics/images/appnavbar/nav-icon-user.png",
        new_url: "/pages/user/user",
        text: "我",
        url: "/pages/user/user",
        index:3
      }
    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let _self = this;
    this.setContainerHeight();
    app.request({
      url: api.default.brand,
      data: {brand_id:options.cat_id},
      method: "GET",
      success: function(t) {
        _self.setData({
          pic_url:t.pic_url,
          data_tip:t.content
        })
      }
    })
  },
  onShareAppMessage: function(t) {
    var a = this;
    return {
        path: "/pages/edit_list/edit_list?user_id=" + wx.getStorageSync("user_info").id,
        success: function(t) {
            1 == ++share_count && app.shareSendCoupon(a);
        },
        title: a.data.store.name
    };
  },
  setContainerHeight:function(e){
    var sysInfo = wx.getSystemInfoSync();//同步获取设备宽度
    var screenWidth = sysInfo.screenWidth; //获取屏幕的宽度
    var scale=(screenWidth * 2)/1.8;
    this.setData({
      height: scale
    })
  },
})
